abstract class Shape{
    public abstract void draw();
}
class Triangle extends Shape{
    @Override
    public void draw() {
        System.out.println("画一个三角形");
    }
}
class Cycle extends Shape{
    @Override
    public void draw() {
        System.out.println("画一个圆");
    }
}
class Rect extends Shape{
    @Override
    public void draw() {
        System.out.println("画一个矩形");
    }
}
public class Test {
    public static void main(String[] args) {
        Shape[] shapes={new Triangle(), new Cycle(), new Rect()};
        for(Shape shape:shapes){
            shape.draw();
        }
    }
}
